<?php
require_once("Tpl/header.html");
?>
        <div id="main">
            <div class="header">
                <h1>Courses</h1>
            </div>
            <div class="content">
                <div class="table-responsive">
                    <table class="pure-table pure-table-horizontal">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>CourseId</th>
                                <th>Course Name</th>
                                <th>Teacher</th>
                                <th>Latest Problem</th>
                                <th>Source</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                                foreach ($CourseList as $key => $course) {
                                    echo "<tr>".
                                         "<td>".($key+1)."</td>".
                                         "<td><a href=\"/index.php/Problem/index?cid=".$course["SubId"]."\">".$course["SubId"]."</a></td>".
                                         "<td><a href=\"/index.php/Course/detail?cid=".$course["SubId"]."\">".$course["SubName"]."</a></td>".
                                         "<td>".$course["UserName"]."</td>".
                                         "<td>".$course["max(problem.ProDate)"]."</td>".
                                         "<td><a href=\"/index.php/Source/index?cid=".$course["SubId"]."\">Download</a></td>".
                                         "</tr>";
                                }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
